<div id="user_data" class="container" ng-controller="user_Index_Ctrl">
    <div class="panel panel-info" ng-if="indexData">
        <div class="panel-heading">
            <h2 class="panel-title">补全资料</h2>
        </div>
        <div class="panel-body">
            <h5 class="text-primary">请补全您的信息，方便获取系统更多的功能</h5>
        </div>
        <form class="form form-horizontal" name="myForm">
            <div class="form-group">
                <label class="control-label col-sm-2">邮箱</label>
                <div class="col-sm-8">
                    <div class="col-sm-8">
                        <input type="text" class="form-control" ng-model="suer.email" name="email" required ng-pattern="/^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/">
                    </div>
                    <div class="col-sm-4 text-alert control-label text-danger" ng-show="myForm.email.$dirty" ng-messages="myForm.email.$error">
                        <span ng-message="required">邮箱不能为空</span>
                        <span ng-message="!required"><span ng-message="pattern">邮箱格式不正确</span></span>
                    </div>
                </div>
            </div>
        </form>
    </div>
    <div class="panel panel-info" ng-if="!indexData">
        <div class="panel-heading">
            <h2 class="panel-title">基本资料</h2>
        </div>
        <div class="panel-body">
            <h5 class="text-primary">请补全您的信息，方便获取系统更多的功能</h5>
            <div class="col-sm-12">
                <div class="col-sm-1 pull-right ">
                    <button type="button" class=" btn btn-info" ng-click="upDate=!upDate">编辑资料</button>
                </div>
                <div class="col-sm-1 pull-right">
                    <button ype="button" class="btn btn-info" ng-click="upDatePass=!upDatePass">修改密码</button>
                </div>
            </div>
            <div class="col-sm-12">
                <ul class="nav center-block nav-list">
                    <li><span class="col-sm-2">帐号:</span><span ng-bind="userData.id"></span></li>
                    <li><span class="col-sm-2">昵称:</span><span ng-bind="userData.nic"></span></li>
                    <li><span class="col-sm-2">姓名:</span><span ng-bind="userData.name"></span></li>
                    <li><span class="col-sm-2">电话:</span><span ng-bind="userData.tel"></span></li>
                    <li><span class="col-sm-2">邮箱:</span><span ng-bind="userData.email"></span></li>
                    <li><span class="col-sm-2">身份证号:</span><span ng-bind="userData.idnumber"></span></li>
                    <li><span class="col-sm-2">注册时间:</span><span ng-bind="userData.regtime| date:'yyyy年MM月dd日'"></span></li>
                </ul>
            </div>
        </div>
    </div>
    <div class="back_box " ng-show="upDatePass">
        <div class="panel panel-info col-sm-6 col-sm-offset-3 ">
            <div class="panel-heading">
                <h2 class="panel-title">修改信息</h2>
                <span class="close glyphicon glyphicon-remove" ng-click="upDatePass=!upDatePass;remove()"></span>
            </div>
            <form class="form form-horizontal panel-body" name="myFormPass">
                <div class="form-group">
                    <label class="col-sm-2 control-label">旧密码</label>
                    <div class="col-sm-10">
                        <div class="col-sm-8"><input type="password" name="myoldPass" ng-model="updateData.oldPass" placeholder="请输入旧密码" class="form-control"
                                required></div>
                        <div class="col-sm-4 text-alert control-label text-danger" ng-show="myFormPass.myoldPass.$dirty" ng-messages="myFormPass.myOldPass.$error">
                            <span ng-message="required">密码不能为空</span>
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">新密码</label>
                    <div class="col-sm-10">
                        <div class="col-sm-8"><input type="password" name="newPass" ng-model="updateData.newpass" placeholder="请输入旧密码" class="form-control"
                                required ng-minlength="6" ng-maxlength="16"></div>
                        <div class="col-sm-4 text-alert control-label text-danger" ng-show="myFormPass.newPass.$dirty" ng-messages="myFormPass.newPass.$error">
                            <span ng-message="required">密码不能为空</span>
                            <span ng-message="minlength">密码不能小于6位</span>
                            <span ng-message="maxlength">密码不能大于16位</span>
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">再次输入新密码</label>
                    <div class="col-sm-10">
                        <div class="col-sm-8"><input type="password" name="mynewPass" ng-model="updateData.newPass" placeholder="请输入旧密码" class="form-control"
                                required></div>
                        <div class="col-sm-4 text-alert control-label text-danger" ng-show="myFormPass.mynewPass.$dirty" ng-messages="myFormPass.mynewPass.$error">
                            <span ng-message="required">密码不能为空</span>
                            <span ng-show="updateData.newpass!=updateData.newPass">两次密码不符</span>
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <button class="btn btn-info  col-sm-3 col-sm-offset-4" ng-click="UpdateData()">提 交</button>
                </div>
            </form>
        </div>
    </div>
    <div class="back_box " ng-show="upDate">
        <div class="panel panel-info col-sm-6 col-sm-offset-3 ">
            <div class="panel-heading">
                <h2 class="panel-title">修改信息</h2>
                <span class="close glyphicon glyphicon-remove" ng-click="upDate=!upDate;remove()"></span>
            </div>
            <form class="form form-horizontal panel-body" name="myForm">
                <div class="form-group">
                    <label class="col-sm-2 control-label">昵称</label>
                    <div class="col-sm-10">
                        <div class="col-sm-8"><input type="text" name="myNic" ng-model="updateData.nic" placeholder="{{userData.nic}}" class="form-control"
                                required ng-maxlength="12"></div>
                        <div class="col-sm-4 text-alert control-label text-danger" ng-show="myForm.myNic.$dirty" ng-messages="myForm.myNic.$error">
                            <span ng-message="required">昵称不能修改为空</span>
                            <span ng-message="maxlength">昵称长度不能超过12</span>
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">姓名</label>
                    <div class="col-sm-10">
                        <div class="col-sm-8"><input type="text" name="myName" ng-model="updateData.name" placeholder="{{userData.name}}" class="form-control"
                                required></div>
                        <div class="col-sm-4 text-alert control-label text-danger " ng-show="myForm.myName.$dirty" ng-messages="myForm.myName.$error">
                            <span ng-message="required">姓名不能修改为空</span>
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">邮箱</label>
                    <div class="col-sm-10">
                        <div class="col-sm-8"><input type="email" name="myEmail" ng-model="updateData.email" placeholder="{{userData.email}}" class="form-control"
                                required></div>
                        <div class="col-sm-4 text-alert control-label text-danger " ng-show="myForm.myEmail.$dirty" ng-messages="myForm.myEmail.$error">
                            <span ng-message="required">邮箱不能修改为空</span>
                            <span ng-message="email">邮箱格式不正确</span>
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <button class="btn btn-info  col-sm-3 col-sm-offset-4" ng-click="UpdateData()">提 交</button>
                </div>
            </form>
        </div>

    </div>
</div>